Skip to content

Conversation

@aliu39
Copy link
Member

@aliu39 aliu39 commented Jan 10, 2025

Follow-up to #3888

The original PR patched 2 methods used for evaluating feature flags, is_enabled (simple toggle on/off) and get_variant (returns a dict of metadata, see https://docs.getunleash.io/reference/sdks/python#getting-a-variant).

We want to remove all get_variant code since we only support boolean flag evals atm. It seems like the main usecase for variants is reading payloads (non-bool) for A/B/multivariate testing. This could lead to a lot of extraneous flags, so until it is requested and/or we support non-bool values, let's not patch this method.

@codecov
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.16%. Comparing base (288f69a) to head (5bfd873).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3914      +/-   ##
==========================================
- Coverage   80.20%   80.16%   -0.05%     
==========================================
  Files         139      139              
  Lines       15400    15391       -9     
  Branches     2596     2596              
==========================================
- Hits        12352    12338      -14     
- Misses       2203     2208       +5     
  Partials      845      845              
Files with missing lines Coverage Δ
sentry_sdk/integrations/unleash.py 90.00% <ø> (-3.11%) ⬇️

... and 1 file with indirect coverage changes

@aliu39 aliu39 changed the title fix(flags): use feature_enabled field of unleash variants feat(flags): revert get_variant patching code Jan 10, 2025
@aliu39 aliu39 marked this pull request as draft January 10, 2025 18:31
@aliu39 aliu39 changed the title feat(flags): revert get_variant patching code feat(flags): remove get_variant patching code Jan 10, 2025
@aliu39 aliu39 changed the title feat(flags): remove get_variant patching code feat(flags): remove Unleash get_variant patching code Jan 10, 2025
@aliu39 aliu39 marked this pull request as ready for review January 11, 2025 08:49
@getsentry getsentry deleted a comment from cmanallen Jan 13, 2025
Copy link
Contributor

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less code is good!

@antonpirker antonpirker merged commit 2ee194c into master Jan 14, 2025
145 checks passed
@antonpirker antonpirker deleted the aliu/unleash-fix branch January 14, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants